package com.bhatni.messageprocessor.camel;

import asg.cliche.ShellFactory;
import org.apache.camel.CamelContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class App {
    
    

    public static void main(String[] args) throws Exception {
        
        
        if (args.length < 1) {
            System.err.println("Sytnax: MockProcessor <camel context xml file>");
            System.exit(-1);
        }
        
        FileSystemXmlApplicationContext contextSpring = new FileSystemXmlApplicationContext(args[0]);

        CamelContext context = (CamelContext) contextSpring.getBean(CamelContext.class);
        context.start();

        ShellFactory.createConsoleShell("MacroProcessor:", "MacroProcessor: Enter exit to terminate.", new App()).commandLoop();

        context.stop();

    }
}
